package com.chen.root;

import java.time.LocalDateTime;

/**
 * 还贷
 * @author ChenJinLong
 */
public class Hd {

    public static void main(String[] args) {
        LocalDateTime now = LocalDateTime.now();
        // 今年需要还款多少个月
        int currMonth = now.getMonthValue();
        if (now.getDayOfMonth() < 20){
            currMonth -= 1;
        }
        int currMonthNum = 12 - currMonth;
        // 开始年份
        int startYear = now.getYear() + 1;
        // 需要还款多少年
        int yearNum = 2053 - startYear;
        // 需要还款多少个月
        int refundNum = yearNum * 12;
        // 剩余还款金额
        double money = refundNum * 3296.8 + 3688.73 + currMonthNum * 3296.8;
        System.err.println("剩余还款金额: " + money);
    }

}
